<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<style type="text/css">
			*{margin:0;padding:0;font-family: "微软雅黑";}
			html,body{height:100%;}
			body{background: #f3eff0;}
			#out{height:100%;display: -webkit-box;-webkit-box-orient: vertical;}
			header{height:88px;line-height: 88px;font-size: 36px;color:#fff;background: #a90506 url(img/zhuce1.jpg) no-repeat 25px 25px;text-align: center;}
			article{-webkit-box-flex: 1;padding-top:10px;}
			.mess{width:560px;height:90px;margin:18px auto;line-height:90px;font-size: 26px;padding-left:20px;background: #fff;}
			.mess input{border: 0;}
			.zhuBtn{background:url(img/submit1.jpg) repeat-x;width:580px;height:90px;margin:160px auto;border-radius: 10px;display: block;font-size: 34px;line-height: 90px;text-align: center;border: 0;color:#fff;}
		</style>
	
	</head>
	<body>
		<section id="out">
			<header>用户注册</header>
			<article>
				<section class="mess">
					<label>账户名称：</label>
					<input type="text" placeholder="请输入账户"/>
				</section>
				<section class="mess">
					<label>输入密码：</label>
					<input type="text" placeholder="请输入密码"/>
				</section>
				<section class="mess">
					<label>确认密码：</label>
					<input type="text" placeholder="请确认密码"/>
				</section>
				<input type="button" value="确认注册" class="zhuBtn"/>
			</article>
		</section>
	</body>
	<script src="js/jquery183.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(function(){
			bodyScale(640);
			$('.zhuBtn').click(function(){
				if($('.mess:eq(1) input').val()!=$('.mess:eq(2) input').val()){
					alert("两次输入的密码不一致")
				}else{
					$.ajax({
						type:"get",
						url:"http://datainfo.duapp.com/shopdata/userinfo.php",
						async:true,
						data:{
							status:"register",
							userID:$('.mess:eq(0) input').val(),
							password:$('.mess:eq(1) input').val()
						},
						success:function(data){
							switch (data){
								case "0":alert("用户名重名")
									break;
								case "1":alert("注册成功,点击跳转");
										window.open("submit.html","_self");
									break;
								case "2":alert("数据库报错")
									break;
								default:
									break;
							}
						}
					});
				}				
			})
			
			function bodyScale(n){	//屏幕宽度自适应
				var devicewidth=document.documentElement.clientWidth;
				var scale=devicewidth/n;
				document.body.style.zoom=scale;
			}
			window.onresize=function(){			
				bodyScale(640);		
			}
		})
	</script>
</html>
